//
//  YBSanHuiYiKeViewController.m
//  GongXinDangJian
//
//  Created by apple on 17/11/29.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "YBSanHuiYiKeViewController.h"
#import "LPSanHuiYiKeShowView.h"
#import "LPSanHuiYiKeDetailViewController.h"
@interface YBSanHuiYiKeViewController ()
/**  标题数组  */
@property (strong, nonatomic) NSArray  *titlesArray;

@end

@implementation YBSanHuiYiKeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.titlesArray = @[@"支部党员大会", @"党课", @"党支部委员会", @"党小组会", @"自学"];
    CGFloat width = ([UIScreen zj_screenWith] - 200 * [UIScreen zj_screenWScale]) / 3;
    for (int i = 0; i < self.titlesArray.count; i ++) {
        NSInteger yu = i % 2;
        NSInteger zheng = i / 2;
        LPSanHuiYiKeShowView *view = [[LPSanHuiYiKeShowView alloc] initWithFrame:CGRectMake(width + (width + 100 * [UIScreen zj_screenWScale]) * yu, 40 * [UIScreen zj_screenHScale] + navHeight + 170 * [UIScreen zj_screenHScale] * zheng, 100 * [UIScreen zj_screenWScale], 120 * [UIScreen zj_screenHScale]) title:self.titlesArray[i]];
        view.tag = i;
        view.userInteractionEnabled = YES;
        UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapClick:)];
        [view addGestureRecognizer:tap];
        [self.view addSubview:view];
    }
}


- (void)tapClick:(UITapGestureRecognizer *)tap{
    LPSanHuiYiKeDetailViewController *vc = [LPSanHuiYiKeDetailViewController new];
    vc.headLine = self.titlesArray[tap.view.tag];
    [self.navigationController pushViewController:vc animated:YES];
}


@end
